package cn.cityre.tools.db;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author sunzhaoye
 */
public class DataSourceContextHolder {


    private static final Logger log = LoggerFactory.getLogger(DataSourceContextHolder.class);
 
    private static final ThreadLocal<String> contextHolder = new ThreadLocal<>();

    public static void setDbType(String dbType) {
        contextHolder.set(dbType);
        log.info("当前线程数据源----------------:{}", dbType);
    }
  
    public static String getDbType() {
        return contextHolder.get();
    }  
  
    public static void clearDbType() {  
        contextHolder.remove();  
    }  
}  


